package at.fhooe.engine.event.events;

import at.fhooe.engine.event.EventListener;

public class EntityCreatedEvent extends Event {

	public static final String TYPE = "EntityCreated";
	private String m_entityId;
	private String m_entityName;
	private double m_positionX;
	private double m_positionY;
	private double m_size;
	
	public EntityCreatedEvent(String entityId, String entityName) {
		super(TYPE);
		m_entityId = entityId;
		m_entityName = entityName;
		m_positionX = 0;
		m_positionY = 0;
		m_size = 0;
	}
	
	public EntityCreatedEvent(String entityId, String entityName, double posX, double posY, double size) {
		super(TYPE);
		m_entityId = entityId;
		m_entityName = entityName;
		m_positionX = posX;
		m_positionY = posY;
		m_size = size;
	}
	
	public double getPositionX() {
		return m_positionX;
	}

	public double getPositionY() {
		return m_positionY;
	}

	public double getSize() {
		return m_size;
	}

	public String getEntityId() {
		return m_entityId;
	}
	
	public String getEntityName() {
		return m_entityName;
	}

	@Override
	public void processEvent(EventListener eventListener) {
		((Listener) eventListener).onEntityCreatedEvent(this);		
	}
	
	//embedded listener interface with the specific function call
	public interface Listener extends EventListener {
		public void onEntityCreatedEvent(EntityCreatedEvent entityCreatedEvent);
	}

}
